<template>
	<el-form
		ref="form"
		class="plr-1"
		label-position="top"
		:model="form"
		:disabled="saving"
		:rules="rules"
	>
		<el-form-item label="跳转链接" class="mt-1" prop="link" :rules="rules.link">
			<el-input
				v-model="form.link"
				placeholder="http://xxx.com 或 https://xxx.com"
				clearable
				:disabled="form.disabled"
			/>
		</el-form-item>
	</el-form>
</template>
<script>
export default {
	props: {
		saving: Boolean,
		view: {
			type: Object,
			default: () => ({})
		}
	},
	data() {
		return {
			form: this.view.options,
			rules: {
				link: [{ type: "url", message: "链接格式不正确" }]
			}
		};
	}
};
</script>
